import { mapState } from "vuex";
import webUrl from "@/config/otherLink";
export default {
  data() {
    return {
      // url: 'http://localhost:8080',
      url: webUrl.approve, //process.env.NODE_ENV == 'pre' ? 'http://39.107.26.138:8853' : process.env.NODE_ENV == 'prod' ? 'https://approve.yundaizhang.com.cn' : process.env.NODE_ENV == 'newProd' ? 'https://approve.zhangsanfeng.vip' : 'http://8.142.139.164:8853',
      loading: false,
      random: "",
      getTokenParams: {
        appKey: "",
        credentialId: "",
        userId: "",
        appSecret: "",
        customerId: "",
      },
    };
  },
  computed: {
    ...mapState({
      userInfo: (state) => state.common.userInfo,
      uif: (state) => state.common.uif,
    }),
  },
  methods: {},
  created() {
    const { appKey, credentialId, UserId, appSecret, subid } = this.userInfo;
    this.getTokenParams = {
      appKey,
      credentialId,
      userId: UserId,
      appSecret,
      customerId: subid,
    };
    // this.loading = true
    // console.clear()
  },
  mounted() {
    this.random = Math.random() * 100;
    this.loading = true;
    let than = this;
    window.addEventListener("message", function () {
      // 监听子页面想父页面的传参
      than.loading = false;
    });
  },
};
